--------------------------------------------------------------------------------
      name:  <unnamed>
       log:  E:\Seagate Sync\VOL\Personal folder\Documents\Research\Past project
> s\cbld\Posted\121020 Website\Data analysis\cbld-description02-fig02.log
  log type:  text
 opened on:  21 Oct 2012, 15:41:10

. 
. 
. * ****************************************************************************
> *******
. * Fig. 2. Real-world coalition-building dynamics in the Council of the Europea
> n Union
. * ****************************************************************************
> *******
. 
. * Programme:    cbld-description02-fig02.do
. * Project:              Council coalition building
. * Author:               Frank Haege, Department of Politics and Administration
> , University of Limerick
. * Contact:              frank.haege@ul.ie
. 
. * Description
. *************
. * This do-file generates a graph of four snapshots of member state positions i
> n 
. * Council negotiations leading to the adoption of a common position on the 
. * batteries directive between June and December 2004. Note that the arrows 
. * indicating changes in positions between two snapshots were added manually
. * in Stata's graph editor.
. 
. 
. * Set up Stata
. version 11

. clear all

. macro drop _all

. set linesize 80

. set more off

. 
. * Load member state position data from empirical case study
. insheet using "Experiments\Other data\cbld-case-study-121020-stata.csv", clear
(28 vars, 8 obs)

. 
. * Reshape dataset into long format (from time-issue to time-issue-country obse
> rvations)
. reshape long country_, i(issue round) j(country) string
(note: j = at be cy cz de dk ee el es fi fr hu ie it lt lv mt nl pl pt se si sk 
> uk)

Data                               wide   ->   long
-----------------------------------------------------------------------------
Number of obs.                        8   ->     192
Number of variables                  28   ->       6
j variable (24 values)                    ->   country
xij variables:
   country_at country_be ... country_uk   ->   country_
-----------------------------------------------------------------------------

. rename country_ position

. 
. *Reshape dataset into wide format (from time-issue-country to time-country obs
> ervations)
. reshape wide position, i(round country) j(issue)
(note: j = 1 2)

Data                               long   ->   wide
-----------------------------------------------------------------------------
Number of obs.                      192   ->      96
Number of variables                   6   ->       6
j variable (2 values)             issue   ->   (dropped)
xij variables:
                               position   ->   position1 position2
-----------------------------------------------------------------------------

. 
. 
. * Generate and recode variables for plotting
. ********************************************
. 
. * Recode and rename negotiation round variable
. replace round = round - 1
(96 real changes made)

. rename round time

. 
. * Generate axis coordinate variables for issue dimensions
. tab position1, m

 1 position |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |          5        5.21        5.21
          2 |         25       26.04       31.25
          3 |         15       15.63       46.88
          4 |         21       21.88       68.75
          5 |         21       21.88       90.63
          6 |          2        2.08       92.71
          . |          7        7.29      100.00
------------+-----------------------------------
      Total |         96      100.00

. recode position1 (1 = -8) (2 = -5) (3 = -2) (4 = 2) (5 = 5) (6 = 8), gen(xcor)
(68 differences between position1 and xcor)

. tab xcor, m

  RECODE of |
  position1 |
         (1 |
  position) |      Freq.     Percent        Cum.
------------+-----------------------------------
         -8 |          5        5.21        5.21
         -5 |         25       26.04       31.25
         -2 |         15       15.63       46.88
          2 |         21       21.88       68.75
          5 |         21       21.88       90.63
          8 |          2        2.08       92.71
          . |          7        7.29      100.00
------------+-----------------------------------
      Total |         96      100.00

. tab position2, m

 2 position |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |          9        9.38        9.38
          1 |         23       23.96       33.33
          2 |         44       45.83       79.17
          3 |         11       11.46       90.62
          4 |          2        2.08       92.71
          . |          7        7.29      100.00
------------+-----------------------------------
      Total |         96      100.00

. recode position2 (0 = -8) (1 = -4) (2 = 0) (3 = 4) (4 = 8), gen(ycor)
(89 differences between position2 and ycor)

. tab ycor, m

  RECODE of |
  position2 |
         (2 |
  position) |      Freq.     Percent        Cum.
------------+-----------------------------------
         -8 |          9        9.38        9.38
         -4 |         23       23.96       33.33
          0 |         44       45.83       79.17
          4 |         11       11.46       90.62
          8 |          2        2.08       92.71
          . |          7        7.29      100.00
------------+-----------------------------------
      Total |         96      100.00

. 
. * Drop original issue position variables
. drop position1 position2

. 
. * Generate voting weight variable
. generate vweight = .
(96 missing values generated)

. replace vweight = 12 if country == "be"
(4 real changes made)

. replace vweight = 29 if country == "fr"
(4 real changes made)

. replace vweight = 29 if country == "de"
(4 real changes made)

. replace vweight = 29 if country == "it"
(4 real changes made)

. replace vweight = 13 if country == "nl"
(4 real changes made)

. replace vweight = 7 if country == "dk"
(4 real changes made)

. replace vweight = 7 if country == "ie"
(4 real changes made)

. replace vweight = 29 if country == "uk"
(4 real changes made)

. replace vweight = 12 if country == "el"
(4 real changes made)

. replace vweight = 12 if country == "pt"
(4 real changes made)

. replace vweight = 27 if country == "es"
(4 real changes made)

. replace vweight = 10 if country == "at"
(4 real changes made)

. replace vweight = 7 if country == "fi"
(4 real changes made)

. replace vweight = 10 if country == "se"
(4 real changes made)

. replace vweight = 3 if country == "cy"
(4 real changes made)

. replace vweight = 12 if country == "cz"
(4 real changes made)

. replace vweight = 4 if country == "ee"
(4 real changes made)

. replace vweight = 12 if country == "hu"
(4 real changes made)

. replace vweight = 4 if country == "lv"
(4 real changes made)

. replace vweight = 7 if country == "lt"
(4 real changes made)

. replace vweight = 3 if country == "mt"
(4 real changes made)

. replace vweight = 27 if country == "pl"
(4 real changes made)

. replace vweight = 7 if country == "sk"
(4 real changes made)

. replace vweight = 4 if country == "si"
(4 real changes made)

. 
. * Generate weighted coalition size variable
. sum time xcor ycor

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
        time |        96         1.5    1.123903          0          3
        xcor |        89   -.3595506    4.434491         -8          8
        ycor |        89   -1.168539    3.577823         -8          8

. egen wmycoalsize = sum(vweight), by(time xcor ycor)

. 
. * Label variables
. label var xcor "Ban on Cadmium"

. label var ycor "Collection Targets"

. label var time "Time" 

. label var country "Country"

. label var vweight "Voting weight"

. label var wmycoalsize "Coalition size (weighted votes)"

. label var document "Number of Council source document"

. label var date "Date of position snapshot"

. 
. 
. * Plot of member state positions before Coreper meeting on 24 November
. **********************************************************************
. 
. * Identify voting weight size of coalitions
. tab wmycoalsize if time == 0

  Coalition |
       size |
  (weighted |
     votes) |      Freq.     Percent        Cum.
------------+-----------------------------------
          7 |          3       12.50       12.50
         10 |          1        4.17       16.67
         14 |          2        8.33       25.00
         24 |          2        8.33       33.33
         27 |          1        4.17       37.50
         29 |          2        8.33       45.83
         33 |          2        8.33       54.17
         34 |          4       16.67       70.83
         46 |          5       20.83       91.67
         56 |          2        8.33      100.00
------------+-----------------------------------
      Total |         24      100.00

. tab wmycoalsize if time == 0 & xcor != .

  Coalition |
       size |
  (weighted |
     votes) |      Freq.     Percent        Cum.
------------+-----------------------------------
          7 |          3       15.00       15.00
         10 |          1        5.00       20.00
         14 |          2       10.00       30.00
         24 |          2       10.00       40.00
         27 |          1        5.00       45.00
         29 |          2       10.00       55.00
         33 |          2       10.00       65.00
         46 |          5       25.00       90.00
         56 |          2       10.00      100.00
------------+-----------------------------------
      Total |         20      100.00

. 
. * Generate marker symbol size weights as a function of coalition size   
. local 7 = 7^.5

. local 10 = 10^.5

. local 14 = 14^.5

. local 24 = 24^.5

. local 27 = 27^.5

. local 29 = 29^.5

. local 33 = 33^.5

. local 46 = 46^.5

. local 56 = 56^.5

.         
. * Plot member state positions   
. twoway (scatter ycor xcor if time == 0 & wmycoalsize == 56, /*
>         */ msymbol(o) msize(*`56') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 0 & wmycoalsize == 46, /*
>         */ msymbol(o) msize(*`46') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 0 & wmycoalsize == 33, /*
>         */ msymbol(o) msize(*`33') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 0 & wmycoalsize == 29, /*
>         */ msymbol(o) msize(*`29') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 0 & wmycoalsize == 27, /*
>         */ msymbol(o) msize(*`27') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 0 & wmycoalsize == 24, /*
>         */ msymbol(o) msize(*`24') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 0 & wmycoalsize == 14, /*
>         */ msymbol(o) msize(*`14') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 0 & wmycoalsize == 10, /*
>         */ msymbol(o) msize(*`10') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 0 & wmycoalsize == 7, /*
>         */ msymbol(o) msize(*`7') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 0 & wmycoalsize > 3, /*
>         */ xlabel(-10 -5:10) ylabel(-10 -5:10) /*
>         */ xscale(range(-10 10)) yscale(range(-10 10)) /*
>         */ msymbol(i) mlabel(wmycoalsize) mlabsize(small) mlabpos(center) /*
>         */ mlabcolor(white) mfcolor(gray) /*
>         */ text(6 -5 "DE", size(vsmall)) /*
>         */ text(3 -8 "FR" "PL", size(vsmall)) /*
>         */ text(-1.7 -5 "IE SK", size(vsmall)) /*
>         */ text(-4 -7.5 "CZ" "PT", size(vsmall) justification(right)) /*
>         */ text(-10 -8 "UK", size(vsmall)) /*
>         */ text(-8 -2.5 "IT" "LV", size(vsmall) justification(left)) /*
>         */ text(-4 6.7 "CY" "SI", size(vsmall) justification(left)) /*
>         */ text(0 7.5 "ES", size(vsmall)) /*
>         */ text(4 2 "AT" "BE" "EE" "FI" "NL", size(vsmall) justification(right
> )) /*
>         */ text(8 9.7 "DK", size(vsmall)) /*
>         */ text(4 9.8 "SE", size(vsmall)) /*
>         */ text(-9 5.5 "No position:" "EL, HU, LT, LU, MT", size(vsmall) justi
> fication(left)) /*
>         */ aspectratio(1) legend(off) subtitle("Coreper (24 Nov.)")) /*
>         */ , saving("Data analysis\Graphs\cbld-description02-fig02a.gph", repl
> ace) 
(file Data analysis\Graphs\cbld-description02-fig02a.gph saved)

. 
. 
. * Plot of member state positions before Coreper meeting on 1 December
. *********************************************************************
. 
. * Identify voting weight size of coalitions
. tab wmycoalsize if time == 1

  Coalition |
       size |
  (weighted |
     votes) |      Freq.     Percent        Cum.
------------+-----------------------------------
          7 |          3       12.50       12.50
         14 |          2        8.33       20.83
         15 |          2        8.33       29.17
         17 |          2        8.33       37.50
         29 |          2        8.33       45.83
         36 |          3       12.50       58.33
         62 |          3       12.50       70.83
        100 |          7       29.17      100.00
------------+-----------------------------------
      Total |         24      100.00

. tab wmycoalsize if time == 1 & xcor != .

  Coalition |
       size |
  (weighted |
     votes) |      Freq.     Percent        Cum.
------------+-----------------------------------
          7 |          3       13.64       13.64
         14 |          2        9.09       22.73
         17 |          2        9.09       31.82
         29 |          2        9.09       40.91
         36 |          3       13.64       54.55
         62 |          3       13.64       68.18
        100 |          7       31.82      100.00
------------+-----------------------------------
      Total |         22      100.00

.         
. * Generate marker symbol size weights as a function of coalition size   
. local 7 = 7^.5

. local 14 = 14^.5

. local 17 = 17^.5

. local 29 = 29^.5

. local 36 = 36^.5

. local 62 = 62^.5

. local 100 = 100^.5

.         
. * Plot member state positions   
. twoway (scatter ycor xcor if time == 1 & wmycoalsize == 100, /*
>         */ msymbol(o) msize(*`100') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 1 & wmycoalsize == 62, /*
>         */ msymbol(o) msize(*`62') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 1 & wmycoalsize == 36, /*
>         */ msymbol(o) msize(*`36') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 1 & wmycoalsize == 29, /*
>         */ msymbol(o) msize(*`29') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 1 & wmycoalsize == 17, /*
>         */ msymbol(o) msize(*`17') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 1 & wmycoalsize == 14, /*
>         */ msymbol(o) msize(*`14') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 1 & wmycoalsize == 7, /*
>         */ msymbol(o) msize(*`7') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 1 & wmycoalsize > 3, /*
>         */ xlabel(-10 -5:10) ylabel(-10 -5:10) /*
>         */ xscale(range(-10 10)) yscale(range(-10 10)) /*
>         */ msymbol(i) mlabel(wmycoalsize) mlabsize(small) mlabpos(center) /*
>         */ mlabcolor(white) mfcolor(gray) /*
>         */ text(6 -5 "DE", size(vsmall)) /*
>         */ text(2 -8 "FR", size(vsmall)) /*
>         */ text(-1.7 -5 "IE SK", size(vsmall)) /*
>         */ text(-4 -7.8 "EL" "CZ" "PT", size(vsmall) justification(right)) /*
>         */ text(-8 -8.2 "IT" "LV" "UK", size(vsmall) justification(right)) /*
>         */ text(-4 6.7 "CY" "SI", size(vsmall) justification(left)) /*
>         */ text(0 9 "BE" "EE" "ES" "LT" "NL" "PL" "SE", size(vsmall) justifica
> tion(left)) /*
>         */ text(8 6.5 "DK", size(vsmall)) /*
>         */ text(4 7 "AT" "FI", size(vsmall) justification(left)) /*
>         */ text(-9.5 4.5 "No position: HU, LU, MT", size(vsmall) justification
> (left)) /*
>         */ aspectratio(1) legend(off) subtitle("Coreper (1 Dec.)"))     /*
>         */ , saving("Data analysis\Graphs\cbld-description02-fig02b.gph", repl
> ace) 
(file Data analysis\Graphs\cbld-description02-fig02b.gph saved)

. 
. 
. * Plot of member state positions before Coreper meeting on 8 December
. *********************************************************************
. 
. * Identify voting weight size of coalitions
. tab wmycoalsize if time == 2

  Coalition |
       size |
  (weighted |
     votes) |      Freq.     Percent        Cum.
------------+-----------------------------------
          3 |          2        8.33        8.33
          4 |          1        4.17       12.50
          7 |          1        4.17       16.67
         13 |          1        4.17       20.83
         29 |          1        4.17       25.00
         36 |          3       12.50       37.50
         43 |          3       12.50       50.00
         62 |          3       12.50       62.50
        116 |          9       37.50      100.00
------------+-----------------------------------
      Total |         24      100.00

. tab wmycoalsize if time == 2 & xcor != .

  Coalition |
       size |
  (weighted |
     votes) |      Freq.     Percent        Cum.
------------+-----------------------------------
          3 |          1        4.35        4.35
          4 |          1        4.35        8.70
          7 |          1        4.35       13.04
         13 |          1        4.35       17.39
         29 |          1        4.35       21.74
         36 |          3       13.04       34.78
         43 |          3       13.04       47.83
         62 |          3       13.04       60.87
        116 |          9       39.13      100.00
------------+-----------------------------------
      Total |         23      100.00

. 
. * Generate marker symbol size weights as a function of coalition size   
. local 3 = 3^.5

. local 4 = 4^.5

. local 7 = 7^.5

. local 13 = 13^.5

. local 29 = 29^.5

. local 36 = 36^.5

. local 43 = 43^.5

. local 62 = 62^.5

. local 116 = 116^.5

.         
. * Plot member state positions   
. twoway (scatter ycor xcor if time == 2 & wmycoalsize == 3, /*
>         */ msymbol(o) msize(*`3') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 2 & wmycoalsize == 116, /*
>         */ msymbol(o) msize(*`116') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 2 & wmycoalsize == 62, /*
>         */ msymbol(o) msize(*`62') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 2 & wmycoalsize == 43, /*
>         */ msymbol(o) msize(*`43') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 2 & wmycoalsize == 36, /*
>         */ msymbol(o) msize(*`36') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 2 & wmycoalsize == 29, /*
>         */ msymbol(o) msize(*`29') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 2 & wmycoalsize == 13, /*
>         */ msymbol(o) msize(*`13') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 2 & wmycoalsize == 7, /*
>         */ msymbol(o) msize(*`7') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 2 & wmycoalsize == 4, /*
>         */ msymbol(o) msize(*`4') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 2 & wmycoalsize > 3, /*
>         */ xlabel(-10 -5:10) ylabel(-10 -5:10) /*
>         */ xscale(range(-10 10)) yscale(range(-10 10)) /*
>         */ msymbol(i) mlabel(wmycoalsize) mlabsize(small) mlabpos(center) /*
>         */ mlabcolor(white) mfcolor(gray) /*
>         */ text(3.3 -5 "DE" "IE" "SK", size(vsmall)) /*
>         */ text(2 -8 "FR", size(vsmall)) /*
>         */ text(-1.8 -2 "NL", size(vsmall)) /*
>         */ text(-4 -7.8 "EL" "CZ" "PT", size(vsmall) justification(right)) /*
>         */ text(-8 -8.2 "IT" "LV" "UK", size(vsmall) justification(right)) /*
>         */ text(-4 6.5 "CY", size(vsmall)) /*
>         */ text(-4 3.3 "SI", size(vsmall)) /*
>         */ text(0 7 "AT BE" "DK EE" "ES HU" "LT PL" "SE", size(vsmall) justifi
> cation(left)) /*
>         */ text(5.5 2 "FI", size(vsmall)) /*
>         */ text(-9.5 5.5 "No position: LU, MT", size(vsmall) justification(lef
> t)) /*
>         */ aspectratio(1) legend(off) subtitle("Coreper (8 Dec.)"))     /*
>         */ , saving("Data analysis\Graphs\cbld-description02-fig02c.gph", repl
> ace)      
(file Data analysis\Graphs\cbld-description02-fig02c.gph saved)

. 
. 
. * Plot of member state positions before Council meeting on 20 December
. **********************************************************************
. 
. * Identify voting weight size of coalitions
. tab wmycoalsize if time == 3

  Coalition |
       size |
  (weighted |
     votes) |      Freq.     Percent        Cum.
------------+-----------------------------------
          4 |          1        4.17        4.17
         91 |          9       37.50       41.67
        104 |          8       33.33       75.00
        117 |          6       25.00      100.00
------------+-----------------------------------
      Total |         24      100.00

. tab wmycoalsize if time == 3 & xcor != .

  Coalition |
       size |
  (weighted |
     votes) |      Freq.     Percent        Cum.
------------+-----------------------------------
          4 |          1        4.17        4.17
         91 |          9       37.50       41.67
        104 |          8       33.33       75.00
        117 |          6       25.00      100.00
------------+-----------------------------------
      Total |         24      100.00

.         
. * Generate marker symbol size weights as a function of coalition size   
. local 4 = 4^.5

. local 91 = 91^.5

. local 104 = 104^.5

. local 117 = 117^.5

. 
. * Plot member state positions   
. twoway (scatter ycor xcor if time == 3 & wmycoalsize == 117, /*
>         */ msymbol(o) msize(*`117') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 3 & wmycoalsize == 104, /*
>         */ msymbol(o) msize(*`104') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 3 & wmycoalsize == 91, /*
>         */ msymbol(o) msize(*`91') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 2 & wmycoalsize == 4, /*
>         */ msymbol(o) msize(*`4') mcolor(white) mfcolor(gray)) /*
>         */ (scatter ycor xcor if time == 3 & wmycoalsize > 3, /*
>         */ xlabel(-10 -5:10) ylabel(-10 -5:10) /*
>         */ xscale(range(-10 10)) yscale(range(-10 10)) /*
>         */ msymbol(i) mlabel(wmycoalsize) mlabsize(small) mlabpos(center) /*
>         */ mlabcolor(white) mfcolor(gray) /*
>         */ text(4 -2 "DE FR HU" "IE NL PL", size(vsmall)) /*
>         */ text(-4 -6.5 "IT EL" "CY CZ" "LV MT" "PT UK", size(vsmall) justific
> ation(right)) /*
>         */ text(-4 3.3 "SI", size(vsmall)) /*
>         */ text(0 6.5 "AT BE" "DK EE" "ES FI" "LT SE" "SK", size(vsmall) justi
> fication(left)) /*
>         */ text(-9.5 6.5 "No position: LU", size(vsmall) justification(left)) 
> /*
>         */ aspectratio(1) legend(off) subtitle("Council (20 Dec.)")) /*
>         */ , saving("Data analysis\Graphs\cbld-description02-fig02d.gph", repl
> ace) 
(file Data analysis\Graphs\cbld-description02-fig02d.gph saved)

. 
. 
. * Combine plots of member state positions at different point in time into a si
> ngle graph
. ******************************************************************************
> **********
. 
. * Combine plots
. graph combine /*
>         */ "Data analysis\Graphs\cbld-description02-fig02a.gph" /*
>         */ "Data analysis\Graphs\cbld-description02-fig02b.gph" /*
>         */ "Data analysis\Graphs\cbld-description02-fig02c.gph" /*
>         */ "Data analysis\Graphs\cbld-description02-fig02d.gph" /*
>         */ , xsize(3) ysize(3) imargin(tiny) saving("Data analysis\Graphs\cbld
> -description02-fig02.gph", replace)
(file Data analysis\Graphs\cbld-description02-fig02.gph saved)

. 
.         
. * Exit do-file
. log close
      name:  <unnamed>
       log:  E:\Seagate Sync\VOL\Personal folder\Documents\Research\Past project
> s\cbld\Posted\121020 Website\Data analysis\cbld-description02-fig02.log
  log type:  text
 closed on:  21 Oct 2012, 15:41:24
--------------------------------------------------------------------------------
